#!/bin/sh

killall -9 monitor.sh
killall -9 air_flash
killall -9 usb.sh
killall -9 bondCheck.sh
killall -9 rsync

cp -r AIR_FLASH/*   /AIR_FLASH/

rm -fr /upload/data/video

chmod 777 -R /AIR_FLASH/*

if [ ! -f "/AIR_FLASH/license.txt" ] ; then		
    cp AIR_FLASH/license.txt /AIR_FLASH/license.txt > /dev/null 2>&1
    cp /AIR_FLASH/license_6A.txt /AIR_FLASH/license.txt > /dev/null 2>&1
fi
source /AIR_FLASH/system/air_sys.conf

#配置文件添加配置示例
#if [ -z "${gateway}" ] ; then
#    echo "gateway=192.168.100.1" >> /AIR_FLASH/system/air_sys.conf
#fi


tpath=`pwd`

cd ../
rm -fr $tpath

cd /AIR_FLASH/script
if [[ -f "${prefix}/script/bondCheck.sh" ]] && [[ "${Netbond}" == "bond0" ]] ; then
    ./bondCheck.sh &
fi
/AIR_FLASH/air_flash -C /AIR_FLASH/script/air.conf &
if [ -f "./usb.sh" ] ; then
    ./usb.sh &
    sleep 1
fi
sleep 3
./monitor.sh
cd /

